<?php

namespace app\admin\validate;

use think\Validate;
use app\common\Error;

class MicroStory extends Validate
{
    protected $rule = [
        'id' => 'require',
        // 'applet_id' => 'require',
        'title' => 'require',
        'cover' => 'require',
        'author' => 'require',
        'content' => 'require',
        'is_release' => 'require',
    ];

    protected $message = [
        'id.require' => Error::ID_NOT_EXIXTS,
        // 'applet_id.require' => Error::APPLET_ID_NOT_EXIXTS,
        'title.require' => Error::TITLE_NOT_EXIXTS,
        'cover.require' => Error::COVER_NOT_EXIXTS,
        'author.require' => Error::AUTHOR_NOT_EXIXTS,
        'content.require' => Error::CONTENT_NOT_EXIXTS,
        'is_release.require' => Error::IS_RELEASE_NOT_EXIXTS,
    ];

    protected $scene = [
        'add' => ['title', 'cover', 'author', 'content', 'is_release'],
        'edit' => ['id', 'title', 'cover', 'author', 'content', 'is_release'],
        'delete' => ['id'],
        'detail' => ['id'],
    ];
}